package sceneGraph;

import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;

/**
 * 
 * Représente un noeud Translation et Rotation.
 */
public class SceneTranslationRotationNode extends SceneNode {

	private float translationX = 0;
	private float translationY = 0;
	private float translationZ = 0;
	
	private float angle = 0;
	private float rotationX = 0;
	private float rotationY = 0;
	private float rotationZ = 0;
	
	public SceneTranslationRotationNode(float translationX, float translationY, float translationZ, float angle, float rotationX, float rotationY, float rotationZ) {
		this.translationX = translationX;
		this.translationY = translationY;
		this.translationZ = translationZ;
		
		this.angle = angle;
		this.rotationX = rotationX;
		this.rotationY = rotationY;
		this.rotationZ = rotationZ;
	}
	
	@Override
	public void draw(GLAutoDrawable gLDrawable) {
		GL gl = gLDrawable.getGL();
		gl.glPushMatrix();
		
		gl.glTranslatef(translationX, translationY, translationZ);
		gl.glRotatef(angle, rotationX, rotationY, rotationZ);
		
		super.draw(gLDrawable);
		gl.glPopMatrix();
	}



	
}
